<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>上传考试题目</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
</head>
<body>
    <div class="container mt-5">
        <h1 class="text-center">上传考试题目</h1>

        {% with messages = get_flashed_messages(with_categories=true) %}
        {% if messages %}
            {% for category, message in messages %}
                <div class="alert alert-{{ category }} text-center" role="alert">
                    {{ message }}
                </div>
            {% endfor %}
        {% endif %}
        {% endwith %}

        <form action="{{ url_for('upload_exam_questions', exam_name=exam_name) }}" method="POST" enctype="multipart/form-data">
            <div class="form-group">
                <label for="question_type" class="form-label">题目类型:</label>
                <select id="question_type" name="question_type" class="form-control" required>
                    <option value="questionsxuanze">选择题</option>
                    <option value="question2">判断题</option>
                    <option value="questions">主观题</option>
                </select>
            </div>
            <div class="form-group">
                <label for="file" class="form-label">上传题目文件 (docx 格式):</label>
                <input type="file" id="file" name="file" class="form-control-file" required>
            </div>
            <button type="submit" class="btn btn-primary w-100 mt-3">上传题目</button>
        </form>
    </div>
</body>
</html>
